1. Field of the Invention
The apparatus and method according to the invention pertains to peripheral states registers embedded in a microcontrollers, and more specifically, using scan hardware to capture peripheral device states.
2. Description of the Related Art
The proliferation of electronic goods such as telephones, televisions, and video camcorders has been made possible by integrated circuit technology. One type of integrated circuit especially important to electronic devices is the microcontroller.
A microcontroller, or embedded controller, is similar to a microprocessor as used in a personal computer, but with a great deal of additional functionality combined onto the same monolithic semiconductor substrate (i.e., chip). In a typical personal computer, the microprocessor performs the basic computing functions, but other integrated circuits perform functions such as communicating over a network, providing input/output with the user, and controlling peripherals.
In a typical microcontroller, many of these functions are embedded within the integrated circuit chip itself. A typical microcontroller, such as the Am186ES by Advanced Micro Devices, Inc., of Sunnyvale, Calif., not only includes a core microprocessor, but further includes a memory controller, a direct memory access (DMA) controller, an interrupt controller, and both asynchronous and synchronous serial interfaces. In computer systems, these peripheral devices are typically implemented as separate integrated circuits, requiring a larger area and increasing the size of the product. By embedding these functions within a single chip, size and cost are reduced, often important in consumer products.
From a consumer products designer""s viewpoint, often the particular combination of added features make a particular microcontroller attractive for a given application. Many microcontrollers are available that use the standard 80xc3x9786 microprocessor instructions, allowing for software to be easily developed for such microcontrollers. Because of the similar execution unit instruction sets, the added features often become principal differentiating criteria between particular microcontrollers.
The peripheral devices embedded in a microcontroller each have their own individual registers. Typical peripheral device registers include state registers, instruction registers, address registers, status registers and data registers. Depending on the peripheral, certain registers store configuration information needed for the peripheral""s proper operation during start up. On system start up, the execution unit initializes each peripheral device with device specific initial configuration data. This initialization could occur during a cold start-up, zero-volt suspend/resume procedure or after a system crash.
In addition to having peripheral devices, many of today""s microcontrollers have embedded test circuitry. In 1985, a group of European companies formed Joint European Test Action Group (JETAG) to devise ways to reduce manufacturing costs. One concept was to incorporate such test circuitry into standard components (controlled via software), eliminating the need for sophisticated in-circuit test equipment. This concept gained support in the U.S., where in 1988, several North American companies formed the Joint Test Access Group (JTAG) consortium to formalize the concept. In 1990, the Institute of Electrical and Electronic Engineers (IEEE) refined the concept and created the 1149.1 standard (which is incorporated herein by reference), known as IEEE Standard Test Access Port and Boundary Scan Architecture.
In such an architecture, a JTAG test device is connected to a microcontroller and performs a xe2x80x9cboundary-scan testxe2x80x9d on the microcontroller. Boundary scan cells contain shift register elements that connect together to form a scan chain around the core logic circuit. Input/output (I/O) signals freely pass between integrated circuit (IC) pins and the core logic, through the boundary scan cells, in normal mode. However, in test mode, only test signals are allowed to pass into or out of the core logic, via a test port and through the boundary scan chain, providing observability and controllability of the input and output signals. The JTAG test commands are typically drawn from a fairly limited set of commands particularly adapted for testing the interconnections of microcontrollers and are not typically well suited for testing or monitoring its internal logic. Instructions and associated data for testing are read serially into each microcontroller peripheral boundary scan cell registers and read out serially, and after the instructions has been carried out the result is read out serially.
While boundary scan techniques are useful in testing interconnection between components, the scan path does not include internal logic registers. In full scan path design typically all registers and storage elements are connected in the scan paths.
Furthermore, access to registers of peripheral devices may not be possible using I/O commands. Some of these registers may not have both read/write capabilities. Thus, data cannot be written to read-only registers with processor I/O commands and data cannot be read from write-only registers with processor I/O commands.
According to the invention, the configuration states of peripheral devices that are embedded in a microcontroller are saved using scan hardware. Various configuration registers, both internal (non-I/O registers) and external (I/O registers), are connected in a configuration scan path internal to the peripheral device. When it is desirable to save the configuration state(s) of the peripheral device(s), the configuration scan path is scanned, and this data can be stored in an external memory device. The external memory device can either be volatile or non-volatile.
In addition, in one embodiment, the scan path is IEEE 1149.1 compliant. Furthermore, according to the invention, various configuration registers, both internal and external, can be saved to an external memory device without intervention of the execution unit of the microcontroller. Instead of the execution unit issuing read and write commands to the various configuration registers and an external memory, configuration data is scanned out to the external memory via a scan path.
Also according to the invention, the configuration states of peripheral devices can be loaded into peripheral device registers using scan hardware. Configuration states can be stored in external memory and shifted into the configuration registers of peripheral devices via a scan path.
Furthermore, according to the invention, configuration states of peripheral devices can be loaded into peripheral device registers that are read-only and saved from peripheral device registers that are write-only by using this scan path.